package com.hsbc.manager.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.hsbc.entity.Admin;

public interface AdminRepository extends JpaRepository<Admin, Integer>{

	Admin findByUsername(String userName);
	
	@Query(value="select a.id,a.realname,a.username,r.role from bc_admin a left join bc_admin_role ar on a.id=ar.admin_id left join bc_role r on r.id=ar.role_id where a.id=1",nativeQuery=true)
	List<Object[]> findAdminInfo();
}
